this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(t,e,n,i,a,s){"use strict";var o,r;var l=function(t){babelHelpers.inherits(n,t);function n(){var t;babelHelpers.classCallCheck(this,n);t=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(n).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(t),"options",[]);t.setEventNamespace("BX.Landing.UI.Card.IconOptionsCard");return t}babelHelpers.createClass(n,[{key:"getLayout",value:function t(){return this.cache.remember("layout",(function(){return e.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-card landing-ui-card-icon-options --hide">\n\t\t\t\t\t<div class="landing-ui-card-icon-options-title">','</div>\n\t\t\t\t\t<div class="landing-ui-card-icon-options-items"></div>\n\t\t\t\t</div>\n\t\t\t'])),i.Loc.getMessage("LANDING_ICONS_CHANGE_STYLE"))}))}},{key:"getOptionsLayout",value:function t(){return this.getLayout().querySelector(".landing-ui-card-icon-options-items")}},{key:"getOptions",value:function t(){return this.options}},{key:"setOptions",value:function t(n,i){var a=this;if(n.length>0){this.options=n;e.Dom.clean(this.getOptionsLayout());e.Dom.removeClass(this.getLayout(),"--hide");n.forEach((function(t){var n=t===i?" --active":"";var s=e.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['<span class="',"",'"></span>'])),t,n);e.Event.bind(s,"click",a.onOptionClick.bind(a,t));e.Dom.append(s,a.getOptionsLayout())}))}}},{key:"onOptionClick",value:function t(n){this.getOptionsLayout().querySelectorAll("span").forEach((function(t){e.Dom.removeClass(t,"--active");if(e.Dom.hasClass(t,n)){e.Dom.addClass(t,"--active")}}));this.emit("onChange",{option:n})}},{key:"setOptionsByItem",value:function t(n){var i=this;s.IconPanel.getLibraries().then((function(t){if(n.length>0){var a=new Set;var s;t.forEach((function(t){t.categories.forEach((function(t){t.items.forEach((function(t){if(e.Type.isObject(t)){var i=t.options.filter((function(t){return n.every((function(e){return t.split(" ").includes(e)}))}));if(i.length>0){t.options.forEach((function(t){a.add(t)}));s=i[0]}}else{if(n.every((function(e){return t.split(" ").includes(e)}))){a.add(t);s=t}}}))}))}));if(a.size>0){i.setOptions(babelHelpers.toConsumableArray(a),s)}}}))}}]);return n}(n.BaseCard);t.IconOptionsCard=l})(this.BX.Landing.UI.Card=this.BX.Landing.UI.Card||{},BX,BX.Landing.UI.Card,BX.Landing,BX,BX.Landing.UI.Panel);
//# sourceMappingURL=iconoptionscard.bundle.map.js